import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-12-18
 * Time: 19:44
 */

public class test3 {
    static int sum=0;
    static String[] strs=new String[100];
    static int index=-1;
    public static  void LiBai(int hua,int jiou,int tian,String str){
        index++;
        strs[index]=str;
        if(hua>0){
            LiBai(hua-1, jiou-1, tian,"a");
            strs[index]="";
            index--;
        }
        if (tian>0){
            LiBai(hua, jiou*2, tian-1,"b");
            strs[index]="";
            index--;
        }
        if (tian==0&&hua==0&&jiou==1){
            sum++;
            for (int i=0;i<index;i++){
                System.out.print(strs[i]+" ");
            }
            System.out.println(index);
            System.out.println();
            return;
        }
    }
    public static void main(String[] args) {
        LiBai(10,2,5,"");
        System.out.println(sum);
    }
}